MapMatrix
TheMapMatrix
function alters an existing matrix so that it defines a transformation from one rectangle to another, similar to theMapRect
andMapRegion
routines that are described in Inside Macintosh: Imaging.
pascal void MapMatrix (MatrixRecord *matrix, Rect *fromRect, Rect *toRect);
matrix
- Contains a pointer to a matrix structure. The
MapMatrix
function modifies this matrix so that it performs a transformation in the rectangle specified by thetoRect
parameter that is analogous to the transformation it currently performs in the rectangle specified by thefromRect
parameter.fromRect
- Contains a pointer to the source rectangle.
toRect
- Contains a pointer to the destination rectangle.
DESCRIPTION
TheMapMatrix
function affects only the scaling and translation attributes of the matrix. This function is similar toRectMatrix
, with the exception thatMapMatrix
concatenates the translation and scaling operations to the previous contents of the matrix, whereasRectMatrix
first sets the matrix to the identity state.Figure 2-45 shows how the matrix that you obtain from the
MapMatrix
function transforms a source image.Figure 2-45 Transforming an image with the
MapMatrix
functionSEE ALSO
You can create a matrix that maps one rectangle to another by calling theRectMatrix
function, which is described in the previous section.